package com.jp.knowledge.my.business;

import com.jp.knowledge.my.activity.OptionSelectActivity;
import com.jp.knowledge.my.model.OptionSelectModel;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author gzejia 978862664@qq.com
 */
public class OptionBusiness {

    /**
     * @param type {@link OptionSelectActivity#OPTION_TYPE}
     * @return 选项集合
     */
    public List<OptionSelectModel> getOptions(int type) {
        String[] companySizeOptions = {"49人及以下", "50-99人", "100-499人", "500-999人", "1000-4999人",
                "5000-9999人", "10000人以上"};
        String[] companyTradeOptions = {"总经办", "软件部", "运营部", "人力资源部", "财务部"};
        String[] schoolStartOptions = {"2016年", "2015年", "2014年", "2013年", "2012年"};
        String[] facultyClassOptions = {"第1班级", "第2班级", "第3班级", "第4班级", "第5班级"};
        List<String> optionNames = new ArrayList<>();
        List<OptionSelectModel> models = new ArrayList<>();

        switch (type) {
            case OptionSelectActivity.OPTION_COMPANY_SIZE:// 公司规模
                optionNames.addAll(Arrays.asList(companySizeOptions));
                break;
            case OptionSelectActivity.OPTION_COMPANY_TRADE:// 行业
                optionNames.addAll(Arrays.asList(companyTradeOptions));
                break;
            case OptionSelectActivity.OPTION_SCHOOL_START:// 入学年份
                optionNames.addAll(Arrays.asList(schoolStartOptions));
                break;
            case OptionSelectActivity.OPTION_FACULTY_CLASS:// 选择班级
                optionNames.addAll(Arrays.asList(facultyClassOptions));
                break;
        }

        for (String name : optionNames) {
            OptionSelectModel model = new OptionSelectModel();
            model.mContent = name;
            models.add(model);
        }

        return models;
    }
}
